<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      width: 200px;
      height: 200px;
      background-color: rgb(187, 150, 156);
    }
  </style>
</head>
<body>
  <div id="app">
    <div class="box" style="font-size: 30px;color: blue;">王宁1</div>
    <div class="box" :style="myStyle">王宁2</div>
    <button @click="change">修改王宁颜色</button>
  </div>
  <script src="./vue.js"></script>
  <script>
    /*
      v-bind 对于样式控制的增强-操作style
      语法 :style = "样式对象"
    */ 
    const app = new Vue({
      el: '#app',
      data: {
        myStyle:{
          fontSize:'30px',
          color:'red'
        }
      },
      methods:{
        change(){
          this.myStyle.color='yellow'
        }
      }
    })
  </script>
</body>
</html>